package com.example.entity;

public class Owner {
    private String name;
    private int age;
    private House house;
    private Car car;

    public Owner(String name, int age) {
        this.name = name;
        this.age = age;
    }

    public void setHouse(House house) {
        this.house = house;
    }

    public void setCar(Car car) {
        this.car = car;
    }

    public void rest() {
        System.out.println("主人在休息");
    }

    public void driveCar() {
        System.out.println("主人在开车");
        car.drive();
    }

    @Override
    public String toString() {
        return "Owner{" +
                "name='" + name + '\'' +
                ", age=" + age +
                ", house=" + house +
                ", car=" + car +
                '}';
    }
}
